#!/bin/bash
cd /Users/ddy/Pictures/iphone6s_20191220

for dir in `ls`;do
  y=`echo $dir | awk -F '-' '{print $1}'`
  m=`echo $dir | awk -F '-' '{print $2}'`
  d=`echo $dir | awk -F '-' '{print $3}'`

  if [[ $m -lt 10 ]]; then
    m="0$m"
  fi
  if [[ $d -lt 10 ]]; then
    d="0$d"
  fi
  new_dir="$y-$m-$d"
  echo "$dir --> $new_dir"
  mv $dir $new_dir
done
